﻿using ReflectionStudio.Core.Events;
using System;
using System.Data;
using System.Windows;
using System.Windows.Data;
using WPFExcelReport.Helpers;
using System.ComponentModel;
namespace WPFExcelReport
{
    public partial class UIGG : ViewBase
    {
        public VGASTGA TMV
        {
            get
            {
                return (VGASTGA)MV;
            }
        }
        #region ==YARN===========
        public static readonly DependencyProperty YARNProperty = DependencyProperty.Register("YARN",
            typeof(string), typeof(UIGG),
            new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnYARNChanged));
        public string YARN
        {
            get
            {
                return (string)GetValue(YARNProperty);
            }
            set
            {
                SetValue(YARNProperty, value);
                OnYARNChg();
            }
        }
        private static void OnYARNChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIGG;
            if (src != null)
            {
                src.YARN = (string)e.NewValue;
            }
        }
        public virtual void OnYARNChg()
        { }
        #endregion

        public UIGG()
        {
    
        }
 
        public override void Window_Loaded(object sender, RoutedEventArgs e)
        {
            if (DesignerProperties.GetIsInDesignMode(this))
                return;
            base.Window_Loaded(sender, e);
        }
        public override void vwMaster_CurrentChanged(object sender, EventArgs e)
        {
            base.vwMaster_CurrentChanged(sender, e);
            if (dwMaster != null)
            {
                KEY = TMV.GAGART+TMV.GAGVAR+TMV.GAGFARBE+TMV.GAGPOS;
                YARN = TMV.GAGGART + TMV.GAGGVAR + TMV.GAGGFARBE;

            }
            else
            {
                KEY = "";
                YARN = "";
            }
        }
    }
}
